//
// Created by superlee on 2021/8/3.
//

#ifndef ROCKPLAYER_DATAQUEUE_H
#define ROCKPLAYER_DATAQUEUE_H
#include <queue>
#include "pthread.h"

extern "C" {
#include "libavcodec/avcodec.h"
};

class DataQueue {

public:
    std::queue<AVPacket *> queuePacket;
    pthread_mutex_t mutexPacket;
    pthread_cond_t condPacket;
    bool playStatus = false;

public:
    DataQueue();
    ~DataQueue();
    int push(AVPacket *packet);
    int getAVPacket(AVPacket *packet);
    int size();
    void clearAVPacket();
};


#endif //ROCKPLAYER_DATAQUEUE_H
